/*      */ package com.yss.sofa.cml.pld;
/*      */ import java.io.IOException;
/*      */ import java.math.BigDecimal;
/*      */ import java.util.HashMap;
/*      */ import java.util.Iterator;
/*      */ import java.util.Map;

/*      */ import org.json.simple.JSONArray;
/*      */ import org.json.simple.JSONObject;
/*      */ import org.json.simple.JSONValue;

/*      */ 
/*      */ import com.yss.sofa.cml.ImageStore;
/*      */ import com.yss.sofa.cml.LinePen;
/*      */ import com.yss.sofa.cml.Paper;
/*      */ import com.yss.sofa.cml.StampElement;
/*      */ import com.yss.sofa.cml.color.Color;
/*      */ import com.yss.sofa.cml.design.BaseCellElement;
/*      */ import com.yss.sofa.cml.design.BytesImageStore;
/*      */ import com.yss.sofa.cml.design.DesignAmount;
/*      */ import com.yss.sofa.cml.design.DesignAmountCurrency;
/*      */ import com.yss.sofa.cml.design.DesignBand;
/*      */ import com.yss.sofa.cml.design.DesignColumn;
/*      */ import com.yss.sofa.cml.design.DesignColumnGroup;
/*      */ import com.yss.sofa.cml.design.DesignDocument;
/*      */ import com.yss.sofa.cml.design.DesignExpression;
/*      */ import com.yss.sofa.cml.design.DesignImage;
/*      */ import com.yss.sofa.cml.design.DesignLineBox;
/*      */ import com.yss.sofa.cml.design.DesignPadding;
/*      */ import com.yss.sofa.cml.design.DesignRow;
/*      */ import com.yss.sofa.cml.design.DesignStyle;
/*      */ import com.yss.sofa.cml.design.DesignText;
/*      */ import com.yss.sofa.cml.geom.DiagonalLine;
/*      */ import com.yss.sofa.cml.geom.Shape;
/*      */ import com.yss.sofa.cml.text.FontKey;
/*      */ import com.yss.sofa.cml.type.AmountDecorationEnum;
/*      */ import com.yss.sofa.cml.type.EvaluationTimeEnum;
/*      */ import com.yss.sofa.cml.type.HorizontalAlignEnum;
/*      */ import com.yss.sofa.cml.type.ImageTypeEnum;
/*      */ import com.yss.sofa.cml.type.LayoutEnum;
/*      */ import com.yss.sofa.cml.type.LineStyleEnum;
/*      */ import com.yss.sofa.cml.type.OrientationEnum;
/*      */ import com.yss.sofa.cml.type.OverflowEnum;
/*      */ import com.yss.sofa.cml.type.ScaleImageEnum;
/*      */ import com.yss.sofa.cml.type.VerticalAlignEnum;

/*      */ import sun.misc.BASE64Decoder;
/*      */ 
/*      */ public class PrintLanguageDefined
/*      */ {
/*   54 */   private static Map<String, ImageStore> imageMap = new HashMap();
/*   55 */   private static Map<String, DesignStyle> styleMap = new HashMap();
/*      */ 
/*   57 */   private static final Map<String, String> PLD_MAP = new HashMap();
/*   58 */   private static final Map<String, String> PLd_CONVERT_MAP = new HashMap();
/*      */   private static final String SPLIT_STR = " ";
/*      */ 
/*      */   private static void initMap()
/*      */   {
/*   68 */     PLD_MAP.put("name", "n");
/*   69 */     PLD_MAP.put("orientation", "o");
/*   70 */     PLD_MAP.put("paper", "p");
/*   71 */     PLD_MAP.put("margins", "m");
/*   72 */     PLD_MAP.put("columnGroup", "cg");
/*   73 */     PLD_MAP.put("background", "b");
/*   74 */     PLD_MAP.put("title", "t");
/*   75 */     PLD_MAP.put("pageHeader", "ph");
/*   76 */     PLD_MAP.put("pageFooter", "pf");
/*   77 */     PLD_MAP.put("columnHeader", "ch");
/*   78 */     PLD_MAP.put("detail", "d");
/*   79 */     PLD_MAP.put("columnFooter", "cf");
/*   80 */     PLD_MAP.put("summary", "su");
/*   81 */     PLD_MAP.put("style", "s");
/*   82 */     PLD_MAP.put("imageStores", "iss");
/*   83 */     PLD_MAP.put("lineBox", "lb");
/*   84 */     PLD_MAP.put("backcolor", "bc");
/*   85 */     PLD_MAP.put("forcecolor", "fc");
/*   86 */     PLD_MAP.put("horizontalAlign", "ha");
/*   87 */     PLD_MAP.put("verticalAlign", "va");
/*   88 */     PLD_MAP.put("font", "f");
/*   89 */     PLD_MAP.put("overflow", "of");
/*   90 */     PLD_MAP.put("pen", "pe");
/*   91 */     PLD_MAP.put("leftPan", "lp");
/*   92 */     PLD_MAP.put("rightPen", "rp");
/*   93 */     PLD_MAP.put("topPen", "tp");
/*   94 */     PLD_MAP.put("bottomPen", "bp");
/*   95 */     PLD_MAP.put("color", "c");
/*   96 */     PLD_MAP.put("lineWidth", "lw");
/*   97 */     PLD_MAP.put("lineStyle", "ls");
/*   98 */     PLD_MAP.put("imageData", "id");
/*   99 */     PLD_MAP.put("width", "w");
/*  100 */     PLD_MAP.put("layout", "l");
/*  101 */     PLD_MAP.put("rows", "r");
/*  102 */     PLD_MAP.put("height", "h");
/*  103 */     PLD_MAP.put("detached", "de");
/*  104 */     PLD_MAP.put("cells", "ce");
/*  105 */     PLD_MAP.put("colspan", "cs");
/*  106 */     PLD_MAP.put("rowspan", "rs");
/*  107 */     PLD_MAP.put("padding", "pa");
/*  108 */     PLD_MAP.put("expression", "e");
/*  109 */     PLD_MAP.put("evaluationTime", "et");
/*  110 */     PLD_MAP.put("printRepeated", "pr");
/*  111 */     PLD_MAP.put("stamp", "st");
/*  112 */     PLD_MAP.put("shapes", "sh");
/*  113 */     PLD_MAP.put("text", "te");
/*  114 */     PLD_MAP.put("amount", "a");
/*  115 */     PLD_MAP.put("amountDecoration", "ad");
/*  116 */     PLD_MAP.put("amountCurrency", "ac");
/*  117 */     PLD_MAP.put("imageScaleType", "it");
/*  118 */     PLD_MAP.put("pattern", "pt");
/*  119 */     PLD_MAP.put("valueClass", "vc");
/*  120 */     PLD_MAP.put("flying", "fl");
/*  121 */     PLD_MAP.put("imageStore", "is");
/*  122 */     PLD_MAP.put("size", "si");
/*      */ 
/*  124 */     PLd_CONVERT_MAP.put("n", "name");
/*  125 */     PLd_CONVERT_MAP.put("o", "orientation");
/*  126 */     PLd_CONVERT_MAP.put("p", "paper");
/*  127 */     PLd_CONVERT_MAP.put("m", "margins");
/*  128 */     PLd_CONVERT_MAP.put("cg", "columnGroup");
/*  129 */     PLd_CONVERT_MAP.put("b", "background");
/*  130 */     PLd_CONVERT_MAP.put("t", "title");
/*  131 */     PLd_CONVERT_MAP.put("ph", "pageHeader");
/*  132 */     PLd_CONVERT_MAP.put("pf", "pageFooter");
/*  133 */     PLd_CONVERT_MAP.put("ch", "columnHeader");
/*  134 */     PLd_CONVERT_MAP.put("d", "detail");
/*  135 */     PLd_CONVERT_MAP.put("cf", "columnFooter");
/*  136 */     PLd_CONVERT_MAP.put("su", "summary");
/*  137 */     PLd_CONVERT_MAP.put("s", "style");
/*  138 */     PLd_CONVERT_MAP.put("iss", "imageStores");
/*  139 */     PLd_CONVERT_MAP.put("lb", "lineBox");
/*  140 */     PLd_CONVERT_MAP.put("bc", "backcolor");
/*  141 */     PLd_CONVERT_MAP.put("fc", "forcecolor");
/*  142 */     PLd_CONVERT_MAP.put("ha", "horizontalAlign");
/*  143 */     PLd_CONVERT_MAP.put("va", "verticalAlign");
/*  144 */     PLd_CONVERT_MAP.put("f", "font");
/*  145 */     PLd_CONVERT_MAP.put("of", "overflow");
/*  146 */     PLd_CONVERT_MAP.put("pe", "pen");
/*  147 */     PLd_CONVERT_MAP.put("lp", "leftPen");
/*  148 */     PLd_CONVERT_MAP.put("rp", "rightPen");
/*  149 */     PLd_CONVERT_MAP.put("tp", "topPen");
/*  150 */     PLd_CONVERT_MAP.put("bp", "bottomPen");
/*  151 */     PLd_CONVERT_MAP.put("c", "color");
/*  152 */     PLd_CONVERT_MAP.put("lw", "lineWidth");
/*  153 */     PLd_CONVERT_MAP.put("ls", "lineStyle");
/*  154 */     PLd_CONVERT_MAP.put("id", "imageData");
/*  155 */     PLd_CONVERT_MAP.put("w", "width");
/*  156 */     PLd_CONVERT_MAP.put("l", "layout");
/*  157 */     PLd_CONVERT_MAP.put("r", "rows");
/*  158 */     PLd_CONVERT_MAP.put("h", "height");
/*  159 */     PLd_CONVERT_MAP.put("de", "detached");
/*  160 */     PLd_CONVERT_MAP.put("ce", "cells");
/*  161 */     PLd_CONVERT_MAP.put("cs", "colspan");
/*  162 */     PLd_CONVERT_MAP.put("rs", "rowspan");
/*  163 */     PLd_CONVERT_MAP.put("pa", "padding");
/*  164 */     PLd_CONVERT_MAP.put("e", "expression");
/*  165 */     PLd_CONVERT_MAP.put("et", "evaluationTime");
/*  166 */     PLd_CONVERT_MAP.put("pr", "printRepeated");
/*  167 */     PLd_CONVERT_MAP.put("st", "stamp");
/*  168 */     PLd_CONVERT_MAP.put("sh", "shapes");
/*  169 */     PLd_CONVERT_MAP.put("te", "text");
/*  170 */     PLd_CONVERT_MAP.put("a", "amount");
/*  171 */     PLd_CONVERT_MAP.put("ad", "amountDecoration");
/*  172 */     PLd_CONVERT_MAP.put("ac", "amountCurrency");
/*  173 */     PLd_CONVERT_MAP.put("it", "imageScaleType");
/*  174 */     PLd_CONVERT_MAP.put("pt", "pattern");
/*  175 */     PLd_CONVERT_MAP.put("vc", "valueClass");
/*  176 */     PLd_CONVERT_MAP.put("fl", "flying");
/*  177 */     PLd_CONVERT_MAP.put("is", "imageStore");
/*  178 */     PLd_CONVERT_MAP.put("si", "size");
/*      */ 
/*  180 */     putValueEntry("orientation", "PORTRAIT", "1");
/*  181 */     putValueEntry("orientation", "LANDSCAPE", "2");
/*  182 */     putValueEntry("paper", "ISO-A0", "0");
/*  183 */     putValueEntry("paper", "ISO-A1", "1");
/*  184 */     putValueEntry("paper", "ISO-A2", "2");
/*  185 */     putValueEntry("paper", "ISO-A3", "3");
/*  186 */     putValueEntry("paper", "ISO-A4", "4");
/*  187 */     putValueEntry("paper", "ISO-A5", "5");
/*  188 */     putValueEntry("paper", "ISO-A6", "6");
/*  189 */     putValueEntry("paper", "ISO-A7", "7");
/*  190 */     putValueEntry("paper", "ISO-A8", "8");
/*  191 */     putValueEntry("paper", "ISO-A9", "9");
/*  192 */     putValueEntry("paper", "ISO-A10", "10");
/*  193 */     putValueEntry("paper", "ISO-B0", "11");
/*  194 */     putValueEntry("paper", "ISO-B1", "12");
/*  195 */     putValueEntry("paper", "ISO-B2", "13");
/*  196 */     putValueEntry("paper", "ISO-B3", "14");
/*  197 */     putValueEntry("paper", "ISO-B4", "15");
/*  198 */     putValueEntry("paper", "ISO-B5", "16");
/*  199 */     putValueEntry("paper", "ISO-B6", "17");
/*  200 */     putValueEntry("paper", "ISO-B7", "18");
/*  201 */     putValueEntry("paper", "ISO-B8", "19");
/*  202 */     putValueEntry("paper", "ISO-B9", "20");
/*  203 */     putValueEntry("paper", "ISO-B10", "21");
/*  204 */     putValueEntry("paper", "JIS-B0", "22");
/*  205 */     putValueEntry("paper", "JIS-B1", "23");
/*  206 */     putValueEntry("paper", "JIS-B2", "24");
/*  207 */     putValueEntry("paper", "JIS-B3", "25");
/*  208 */     putValueEntry("paper", "JIS-B4", "26");
/*  209 */     putValueEntry("paper", "JIS-B5", "27");
/*  210 */     putValueEntry("paper", "JIS-B6", "28");
/*  211 */     putValueEntry("paper", "JIS-B7", "29");
/*  212 */     putValueEntry("paper", "JIS-B8", "30");
/*  213 */     putValueEntry("paper", "JIS-B9", "31");
/*  214 */     putValueEntry("paper", "JIS-B10", "32");
/*  215 */     putValueEntry("paper", "ISO-C0", "33");
/*  216 */     putValueEntry("paper", "ISO-C1", "34");
/*  217 */     putValueEntry("paper", "ISO-C2", "35");
/*  218 */     putValueEntry("paper", "ISO-C3", "36");
/*  219 */     putValueEntry("paper", "ISO-C4", "37");
/*  220 */     putValueEntry("paper", "ISO-C5", "38");
/*  221 */     putValueEntry("paper", "ISO-C6", "39");
/*  222 */     putValueEntry("paper", "NA-LETTER", "40");
/*  223 */     putValueEntry("paper", "NA-LEGAL", "41");
/*  224 */     putValueEntry("paper", "EXECUTIVE", "42");
/*  225 */     putValueEntry("paper", "LEDGER", "43");
/*  226 */     putValueEntry("paper", "TABLOID", "44");
/*  227 */     putValueEntry("paper", "INVOICE", "45");
/*  228 */     putValueEntry("paper", "FOLIO", "46");
/*  229 */     putValueEntry("paper", "QUARTO", "47");
/*  230 */     putValueEntry("paper", "JAPANESE-POSTCARD", "48");
/*  231 */     putValueEntry("paper", "JAPANESE-DOUBLE-POSTCARD", "49");
/*  232 */     putValueEntry("paper", "ISO-DESIGNATED-LONG", "50");
/*  233 */     putValueEntry("paper", "ITALY-ENVELOPE", "51");
/*  234 */     putValueEntry("paper", "MONARCH-ENVELOPE", "52");
/*  235 */     putValueEntry("paper", "PERSONAL-ENVELOPE", "53");
/*  236 */     putValueEntry("paper", "NA-NUMBER-9-ENVELOPE", "54");
/*  237 */     putValueEntry("paper", "NA-NUMBER-10-ENVELOPE", "55");
/*  238 */     putValueEntry("paper", "NA-NUMBER-11-ENVELOPE", "56");
/*  239 */     putValueEntry("paper", "NA-NUMBER-12-ENVELOPE", "57");
/*  240 */     putValueEntry("paper", "NA-NUMBER-14-ENVELOPE", "58");
/*  241 */     putValueEntry("paper", "NA-6X9-ENVELOPE", "59");
/*  242 */     putValueEntry("paper", "NA-7X9-ENVELOPE", "60");
/*  243 */     putValueEntry("paper", "NA-9X11-ENVELOPE", "61");
/*  244 */     putValueEntry("paper", "NA-9X12-ENVELOPE", "62");
/*  245 */     putValueEntry("paper", "NA-10X13-ENVELOPE", "63");
/*  246 */     putValueEntry("paper", "NA-10X14-ENVELOPE", "64");
/*  247 */     putValueEntry("paper", "NA-10X15-ENVELOPE", "65");
/*  248 */     putValueEntry("paper", "NA-5X7", "66");
/*  249 */     putValueEntry("paper", "NA-8X10", "67");
/*  250 */     putValueEntry("paper", "JIS-CHOU-1", "68");
/*  251 */     putValueEntry("paper", "JIS-CHOU-2", "69");
/*  252 */     putValueEntry("paper", "JIS-CHOU-3", "70");
/*  253 */     putValueEntry("paper", "JIS-CHOU-4", "71");
/*  254 */     putValueEntry("paper", "JIS-CHOU-30", "72");
/*  255 */     putValueEntry("paper", "JIS-CHOU-40", "73");
/*  256 */     putValueEntry("paper", "JIS-KAKU-0", "74");
/*  257 */     putValueEntry("paper", "JIS-KAKU-1", "75");
/*  258 */     putValueEntry("paper", "JIS-KAKU-2", "76");
/*  259 */     putValueEntry("paper", "JIS-KAKU-3", "77");
/*  260 */     putValueEntry("paper", "JIS-KAKU-4", "78");
/*  261 */     putValueEntry("paper", "JIS-KAKU-5", "79");
/*  262 */     putValueEntry("paper", "JIS-KAKU-6", "80");
/*  263 */     putValueEntry("paper", "JIS-KAKU-7", "81");
/*  264 */     putValueEntry("paper", "JIS-KAKU-8", "82");
/*  265 */     putValueEntry("paper", "JIS-KAKU-20", "83");
/*  266 */     putValueEntry("paper", "JIS-KAKU-A4", "84");
/*  267 */     putValueEntry("paper", "JIS-YOU-1", "85");
/*  268 */     putValueEntry("paper", "JIS-YOU-2", "86");
/*  269 */     putValueEntry("paper", "JIS-YOU-3", "87");
/*  270 */     putValueEntry("paper", "JIS-YOU-4", "88");
/*  271 */     putValueEntry("paper", "JIS-YOU-5", "89");
/*  272 */     putValueEntry("paper", "JIS-YOU-6", "90");
/*  273 */     putValueEntry("paper", "JIS-YOU-7", "91");
/*  274 */     putValueEntry("paper", "LETTER", "92");
/*  275 */     putValueEntry("paper", "LEGAL", "93");
/*  276 */     putValueEntry("horizontalAlign", "LEFT", "1");
/*  277 */     putValueEntry("horizontalAlign", "CENTER", "2");
/*  278 */     putValueEntry("horizontalAlign", "RIGHT", "3");
/*  279 */     putValueEntry("verticalAlign", "TOP", "0");
/*  280 */     putValueEntry("verticalAlign", "MIDDLE", "1");
/*  281 */     putValueEntry("verticalAlign", "BOTTOM", "2");
/*  282 */     putValueEntry("overflow", "STRETCH", "1");
/*  283 */     putValueEntry("overflow", "SHRINK", "2");
/*  284 */     putValueEntry("overflow", "CLIP", "3");
/*  285 */     putValueEntry("lineStyle", "NONE", "0");
/*  286 */     putValueEntry("lineStyle", "SOLID", "1");
/*  287 */     putValueEntry("lineStyle", "DOUBLE", "2");
/*  288 */     putValueEntry("lineStyle", "DASHED", "3");
/*  289 */     putValueEntry("lineStyle", "DOTTED", "4");
/*  290 */     putValueEntry("layout", "FIXED", "1");
/*  291 */     putValueEntry("layout", "PERCENT", "2");
/*  292 */     putValueEntry("layout", "AUTO", "3");
/*  293 */     putValueEntry("evaluationTime", "NOW", "1");
/*  294 */     putValueEntry("evaluationTime", "END", "2");
/*  295 */     putValueEntry("evaluationTime", "PAGE", "3");
/*  296 */     putValueEntry("amountDecoration", "CURRNCY_UNIT", "1");
/*  297 */     putValueEntry("amountDecoration", "AMOUNT_LINE", "2");
/*  298 */     putValueEntry("amountDecoration", "CURRNCY_LINE", "3");
/*  299 */     putValueEntry("amountDecoration", "NONE", "0");
/*  300 */     putValueEntry("amountCurrency", "CNY", "1");
/*  301 */     putValueEntry("amountCurrency", "HKD", "2");
/*  302 */     putValueEntry("amountCurrency", "EUR", "3");
/*  303 */     putValueEntry("amountCurrency", "SUR", "4");
/*  304 */     putValueEntry("amountCurrency", "USD", "5");
/*  305 */     putValueEntry("imageScaleType", "RETAIN", "1");
/*  306 */     putValueEntry("imageScaleType", "REALSIZE", "2");
/*  307 */     putValueEntry("imageScaleType", "FILL", "3");
/*  308 */     putValueEntry("imageScaleType", "CLIP", "4");
/*  309 */     putValueEntry("style", "PLAIN", "0");
/*  310 */     putValueEntry("style", "BOLD", "1");
/*  311 */     putValueEntry("style", "ITALIC", "2");
/*  312 */     putValueEntry("style", "BOLD_ITALIC", "3");
/*  313 */     putValueEntry("imageType", "GIF", "1");
/*  314 */     putValueEntry("imageType", "JPEG", "2");
/*  315 */     putValueEntry("imageType", "PNG", "3");
/*  316 */     putValueEntry("imageType", "TIFF", "4");
/*      */ 
/*  318 */     putConvertValueEntry("orientation", "PORTRAIT", "1");
/*  319 */     putConvertValueEntry("orientation", "LANDSCAPE", "2");
/*  320 */     putConvertValueEntry("paper", "ISO-A0", "0");
/*  321 */     putConvertValueEntry("paper", "ISO-A1", "1");
/*  322 */     putConvertValueEntry("paper", "ISO-A2", "2");
/*  323 */     putConvertValueEntry("paper", "ISO-A3", "3");
/*  324 */     putConvertValueEntry("paper", "ISO-A4", "4");
/*  325 */     putConvertValueEntry("paper", "ISO-A5", "5");
/*  326 */     putConvertValueEntry("paper", "ISO-A6", "6");
/*  327 */     putConvertValueEntry("paper", "ISO-A7", "7");
/*  328 */     putConvertValueEntry("paper", "ISO-A8", "8");
/*  329 */     putConvertValueEntry("paper", "ISO-A9", "9");
/*  330 */     putConvertValueEntry("paper", "ISO-A10", "10");
/*  331 */     putConvertValueEntry("paper", "ISO-B0", "11");
/*  332 */     putConvertValueEntry("paper", "ISO-B1", "12");
/*  333 */     putConvertValueEntry("paper", "ISO-B2", "13");
/*  334 */     putConvertValueEntry("paper", "ISO-B3", "14");
/*  335 */     putConvertValueEntry("paper", "ISO-B4", "15");
/*  336 */     putConvertValueEntry("paper", "ISO-B5", "16");
/*  337 */     putConvertValueEntry("paper", "ISO-B6", "17");
/*  338 */     putConvertValueEntry("paper", "ISO-B7", "18");
/*  339 */     putConvertValueEntry("paper", "ISO-B8", "19");
/*  340 */     putConvertValueEntry("paper", "ISO-B9", "20");
/*  341 */     putConvertValueEntry("paper", "ISO-B10", "21");
/*  342 */     putConvertValueEntry("paper", "JIS-B0", "22");
/*  343 */     putConvertValueEntry("paper", "JIS-B1", "23");
/*  344 */     putConvertValueEntry("paper", "JIS-B2", "24");
/*  345 */     putConvertValueEntry("paper", "JIS-B3", "25");
/*  346 */     putConvertValueEntry("paper", "JIS-B4", "26");
/*  347 */     putConvertValueEntry("paper", "JIS-B5", "27");
/*  348 */     putConvertValueEntry("paper", "JIS-B6", "28");
/*  349 */     putConvertValueEntry("paper", "JIS-B7", "29");
/*  350 */     putConvertValueEntry("paper", "JIS-B8", "30");
/*  351 */     putConvertValueEntry("paper", "JIS-B9", "31");
/*  352 */     putConvertValueEntry("paper", "JIS-B10", "32");
/*  353 */     putConvertValueEntry("paper", "ISO-C0", "33");
/*  354 */     putConvertValueEntry("paper", "ISO-C1", "34");
/*  355 */     putConvertValueEntry("paper", "ISO-C2", "35");
/*  356 */     putConvertValueEntry("paper", "ISO-C3", "36");
/*  357 */     putConvertValueEntry("paper", "ISO-C4", "37");
/*  358 */     putConvertValueEntry("paper", "ISO-C5", "38");
/*  359 */     putConvertValueEntry("paper", "ISO-C6", "39");
/*  360 */     putConvertValueEntry("paper", "NA-LETTER", "40");
/*  361 */     putConvertValueEntry("paper", "NA-LEGAL", "41");
/*  362 */     putConvertValueEntry("paper", "EXECUTIVE", "42");
/*  363 */     putConvertValueEntry("paper", "LEDGER", "43");
/*  364 */     putConvertValueEntry("paper", "TABLOID", "44");
/*  365 */     putConvertValueEntry("paper", "INVOICE", "45");
/*  366 */     putConvertValueEntry("paper", "FOLIO", "46");
/*  367 */     putConvertValueEntry("paper", "QUARTO", "47");
/*  368 */     putConvertValueEntry("paper", "JAPANESE-POSTCARD", "48");
/*  369 */     putConvertValueEntry("paper", "JAPANESE-DOUBLE-POSTCARD", "49");
/*  370 */     putConvertValueEntry("paper", "ISO-DESIGNATED-LONG", "50");
/*  371 */     putConvertValueEntry("paper", "ITALY-ENVELOPE", "51");
/*  372 */     putConvertValueEntry("paper", "MONARCH-ENVELOPE", "52");
/*  373 */     putConvertValueEntry("paper", "PERSONAL-ENVELOPE", "53");
/*  374 */     putConvertValueEntry("paper", "NA-NUMBER-9-ENVELOPE", "54");
/*  375 */     putConvertValueEntry("paper", "NA-NUMBER-10-ENVELOPE", "55");
/*  376 */     putConvertValueEntry("paper", "NA-NUMBER-11-ENVELOPE", "56");
/*  377 */     putConvertValueEntry("paper", "NA-NUMBER-12-ENVELOPE", "57");
/*  378 */     putConvertValueEntry("paper", "NA-NUMBER-14-ENVELOPE", "58");
/*  379 */     putConvertValueEntry("paper", "NA-6X9-ENVELOPE", "59");
/*  380 */     putConvertValueEntry("paper", "NA-7X9-ENVELOPE", "60");
/*  381 */     putConvertValueEntry("paper", "NA-9X11-ENVELOPE", "61");
/*  382 */     putConvertValueEntry("paper", "NA-9X12-ENVELOPE", "62");
/*  383 */     putConvertValueEntry("paper", "NA-10X13-ENVELOPE", "63");
/*  384 */     putConvertValueEntry("paper", "NA-10X14-ENVELOPE", "64");
/*  385 */     putConvertValueEntry("paper", "NA-10X15-ENVELOPE", "65");
/*  386 */     putConvertValueEntry("paper", "NA-5X7", "66");
/*  387 */     putConvertValueEntry("paper", "NA-8X10", "67");
/*  388 */     putConvertValueEntry("paper", "JIS-CHOU-1", "68");
/*  389 */     putConvertValueEntry("paper", "JIS-CHOU-2", "69");
/*  390 */     putConvertValueEntry("paper", "JIS-CHOU-3", "70");
/*  391 */     putConvertValueEntry("paper", "JIS-CHOU-4", "71");
/*  392 */     putConvertValueEntry("paper", "JIS-CHOU-30", "72");
/*  393 */     putConvertValueEntry("paper", "JIS-CHOU-40", "73");
/*  394 */     putConvertValueEntry("paper", "JIS-KAKU-0", "74");
/*  395 */     putConvertValueEntry("paper", "JIS-KAKU-1", "75");
/*  396 */     putConvertValueEntry("paper", "JIS-KAKU-2", "76");
/*  397 */     putConvertValueEntry("paper", "JIS-KAKU-3", "77");
/*  398 */     putConvertValueEntry("paper", "JIS-KAKU-4", "78");
/*  399 */     putConvertValueEntry("paper", "JIS-KAKU-5", "79");
/*  400 */     putConvertValueEntry("paper", "JIS-KAKU-6", "80");
/*  401 */     putConvertValueEntry("paper", "JIS-KAKU-7", "81");
/*  402 */     putConvertValueEntry("paper", "JIS-KAKU-8", "82");
/*  403 */     putConvertValueEntry("paper", "JIS-KAKU-20", "83");
/*  404 */     putConvertValueEntry("paper", "JIS-KAKU-A4", "84");
/*  405 */     putConvertValueEntry("paper", "JIS-YOU-1", "85");
/*  406 */     putConvertValueEntry("paper", "JIS-YOU-2", "86");
/*  407 */     putConvertValueEntry("paper", "JIS-YOU-3", "87");
/*  408 */     putConvertValueEntry("paper", "JIS-YOU-4", "88");
/*  409 */     putConvertValueEntry("paper", "JIS-YOU-5", "89");
/*  410 */     putConvertValueEntry("paper", "JIS-YOU-6", "90");
/*  411 */     putConvertValueEntry("paper", "JIS-YOU-7", "91");
/*  412 */     putConvertValueEntry("paper", "LETTER", "92");
/*  413 */     putConvertValueEntry("paper", "LEGAL", "93");
/*  414 */     putConvertValueEntry("horizontalAlign", "LEFT", "1");
/*  415 */     putConvertValueEntry("horizontalAlign", "CENTER", "2");
/*  416 */     putConvertValueEntry("horizontalAlign", "RIGHT", "3");
/*  417 */     putConvertValueEntry("verticalAlign", "TOP", "0");
/*  418 */     putConvertValueEntry("verticalAlign", "MIDDLE", "1");
/*  419 */     putConvertValueEntry("verticalAlign", "BOTTOM", "2");
/*  420 */     putConvertValueEntry("overflow", "STRETCH", "1");
/*  421 */     putConvertValueEntry("overflow", "SHRINK", "2");
/*  422 */     putConvertValueEntry("overflow", "CLIP", "3");
/*  423 */     putConvertValueEntry("lineStyle", "NONE", "0");
/*  424 */     putConvertValueEntry("lineStyle", "SOLID", "1");
/*  425 */     putConvertValueEntry("lineStyle", "DOUBLE", "2");
/*  426 */     putConvertValueEntry("lineStyle", "DASHED", "3");
/*  427 */     putConvertValueEntry("lineStyle", "DOTTED", "4");
/*  428 */     putConvertValueEntry("layout", "FIXED", "1");
/*  429 */     putConvertValueEntry("layout", "PERCENT", "2");
/*  430 */     putConvertValueEntry("layout", "AUTO", "3");
/*  431 */     putConvertValueEntry("evaluationTime", "NOW", "1");
/*  432 */     putConvertValueEntry("evaluationTime", "END", "2");
/*  433 */     putConvertValueEntry("evaluationTime", "PAGE", "3");
/*  434 */     putConvertValueEntry("amountDecoration", "CURRNCY_UNIT", "1");
/*  435 */     putConvertValueEntry("amountDecoration", "AMOUNT_LINE", "2");
/*  436 */     putConvertValueEntry("amountDecoration", "CURRNCY_LINE", "3");
/*  437 */     putConvertValueEntry("amountDecoration", "NONE", "0");
/*  438 */     putConvertValueEntry("amountCurrency", "CNY", "1");
/*  439 */     putConvertValueEntry("amountCurrency", "HKD", "2");
/*  440 */     putConvertValueEntry("amountCurrency", "EUR", "3");
/*  441 */     putConvertValueEntry("amountCurrency", "SUR", "4");
/*  442 */     putConvertValueEntry("amountCurrency", "USD", "5");
/*  443 */     putConvertValueEntry("imageScaleType", "RETAIN", "1");
/*  444 */     putConvertValueEntry("imageScaleType", "REALSIZE", "2");
/*  445 */     putConvertValueEntry("imageScaleType", "FILL", "3");
/*  446 */     putConvertValueEntry("imageScaleType", "CLIP", "4");
/*  447 */     putConvertValueEntry("style", "PLAIN", "0");
/*  448 */     putConvertValueEntry("style", "BOLD", "1");
/*  449 */     putConvertValueEntry("style", "ITALIC", "2");
/*  450 */     putConvertValueEntry("style", "BOLD_ITALIC", "3");
/*  451 */     putConvertValueEntry("imageType", "GIF", "1");
/*  452 */     putConvertValueEntry("imageType", "JPEG", "2");
/*  453 */     putConvertValueEntry("imageType", "PNG", "3");
/*  454 */     putConvertValueEntry("imageType", "TIFF", "4");
/*      */   }
/*      */ 
/*      */   private static void putValueEntry(String name, String value, String newValue)
/*      */   {
/*  459 */     String keyString = name + " " + value;
/*  460 */     String valueString = name + " " + newValue;
/*  461 */     PLD_MAP.put(keyString, valueString);
/*      */   }
/*      */ 
/*      */   private static void putConvertValueEntry(String name, String newValue, String value)
/*      */   {
/*  466 */     String keyString = name + " " + value;
/*  467 */     String valueString = name + " " + newValue;
/*  468 */     PLd_CONVERT_MAP.put(keyString, valueString);
/*      */   }
/*      */ 
/*      */   public static String compress(String pld)
/*      */   {
/*  473 */     String plx = "";
/*  474 */     Iterator iter = PLD_MAP.entrySet().iterator();
/*  475 */     while (iter.hasNext()) {
/*  476 */       Map.Entry entry = (Map.Entry)iter.next();
/*  477 */       String keyString = (String)entry.getKey();
/*  478 */       String valueString = (String)entry.getValue();
/*  479 */       if (keyString.indexOf(" ") < 0) {
/*  480 */         plx = pld.replaceAll(keyString, valueString);
/*      */       } else {
/*  482 */         String[] temp = keyString.split(" ");
/*  483 */         String[] tempValue = valueString.split(" ");
/*  484 */         if ((temp.length > 1) && (tempValue.length > 1)) {
/*  485 */           plx = pld.replaceAll(temp[1], tempValue[1]);
/*      */         }
/*      */       }
/*      */     }
/*      */ 
/*  490 */     return plx;
/*      */   }
/*      */ 
/*      */   public static JSONObject unCompressJson(JSONObject jsonObj) {
/*  494 */     Iterator iter = PLd_CONVERT_MAP.entrySet().iterator();
/*  495 */     Iterator iter2 = PLd_CONVERT_MAP.entrySet().iterator();
/*      */ 
/*  497 */     while (iter.hasNext()) {
/*  498 */       Map.Entry entry = (Map.Entry)iter.next();
/*  499 */       String keyString = (String)entry.getKey();
/*  500 */       String valueString = (String)entry.getValue();
/*      */ 
/*  502 */       if (jsonObj.containsKey(keyString)) {
/*  503 */         Object valueObj = jsonObj.get(keyString);
/*      */ 
/*  506 */         if ((valueObj instanceof JSONObject)) {
/*  507 */           JSONObject newValueObj = unCompressJson((JSONObject)valueObj);
/*  508 */           jsonObj.remove(keyString);
/*  509 */           jsonObj.put(valueString, newValueObj);
/*  510 */         } else if ((valueObj instanceof JSONArray)) {
/*  511 */           JSONArray list = (JSONArray)valueObj;
/*  512 */           JSONArray newList = new JSONArray();
/*  513 */           int length = list.size();
/*  514 */           if (length > 0) {
/*  515 */             for (int i = 0; i < length; i++) {
/*  516 */               Object tempList = list.get(i);
/*  517 */               if (((tempList instanceof JSONObject)) || ((tempList instanceof JSONArray)))
/*  518 */                 newList.add(unCompressJson((JSONObject)tempList));
/*      */               else {
/*  520 */                 newList.add(tempList);
/*      */               }
/*      */             }
/*      */           }
/*  524 */           jsonObj.remove(keyString);
/*  525 */           jsonObj.put(valueString, newList);
/*      */         }
/*      */         else {
/*  528 */           String newKey = (String)PLd_CONVERT_MAP.get(keyString);
/*  529 */           Object value = jsonObj.get(keyString);
/*  530 */           jsonObj.remove(keyString);
/*  531 */           jsonObj.put(newKey, value);
/*      */         }
/*      */       }
/*      */ 
/*      */     }
/*      */ 
/*  537 */     while (iter2.hasNext()) {
/*  538 */       Map.Entry entry = (Map.Entry)iter2.next();
/*  539 */       String keyString = (String)entry.getKey();
/*  540 */       String valueString = (String)entry.getValue();
/*  541 */       String[] temp = keyString.split(" ");
/*  542 */       String[] tempValue = valueString.split(" ");
/*  543 */       if ((temp.length > 1) && (tempValue.length > 1)) {
/*  544 */         String oldKey = temp[0];
/*  545 */         String oldValue = temp[1];
/*  546 */         String key = tempValue[0];
/*  547 */         String newValue = tempValue[1];
/*  548 */         if (jsonObj.containsKey(key)) {
/*  549 */           String value = jsonObj.get(key).toString();
/*  550 */           if (oldValue.equals(value)) {
/*  551 */             jsonObj.put(key, newValue);
/*      */           }
/*      */         }
/*      */       }
/*      */     }
/*  556 */     return jsonObj;
/*      */   }
/*      */ 
/*      */   public static String unCompress(String plx)
/*      */   {
/*  561 */     String pld = "";
/*  562 */     JSONObject plxObj = (JSONObject)JSONValue.parse(plx);
/*      */ 
/*  586 */     pld = unCompressJson(plxObj).toJSONString();
/*  587 */     return pld;
/*      */   }
/*      */ 
/*      */   public static DesignDocument decode(String plx)
/*      */   {
/*  599 */     String temp = unCompress(plx);
/*      */ 
/*  603 */     return convert(temp);
/*      */   }
/*      */ 
/*      */   public static String encode(DesignDocument document)
/*      */   {
/*  614 */     String json = JSONValue.toJSONString(document);
/*  615 */     String temp = compress(json);
/*  616 */     return temp;
/*      */   }
/*      */ 
/*      */   public static DesignDocument convert(String json)
/*      */   {
/*  622 */     DesignDocument doc = new DesignDocument();
/*  623 */     JSONObject jsonObj = (JSONObject)JSONValue.parse(json);
/*  624 */     if (jsonObj != null)
/*      */     {
/*  626 */       if (jsonObj.containsKey("imageStores")) {
/*  627 */         JSONArray isList = (JSONArray)jsonObj.get("imageStores");
/*  628 */         int length = isList.size();
/*  629 */         if ((isList != null) && (length > 0)) {
/*  630 */           for (int i = 0; i < length; i++) {
/*  631 */             JSONObject temp = (JSONObject)isList.get(i);
/*  632 */             BytesImageStore isStore = new BytesImageStore();
/*  633 */             String name = null;
/*  634 */             if (temp.containsKey("name")) {
/*  635 */               name = (String)temp.get("name");
/*      */ 
/*  637 */               if (temp.containsKey("imageType")) {
/*  638 */                 String valueString = (String)temp.get("imageType");
/*  639 */                 ImageTypeEnum itEnum = convertImageType(temp, valueString);
/*  640 */                 isStore.setImageType(itEnum);
/*      */               }
/*      */ 
/*  643 */               byte[] data = null;
/*  644 */               if (temp.containsKey("imageData")) {
/*  645 */                 String imgData = (String)temp.get("imageData");
/*      */                 try {
/*  647 */                   data = new BASE64Decoder().decodeBuffer(imgData);
/*  648 */                   isStore.writeBytes(data);
/*      */                 } catch (IOException e) {
/*  650 */                   e.printStackTrace();
/*      */                   try {
/*  652 */                     throw new IOException();
/*      */                   } catch (IOException e1) {
/*  654 */                     e1.printStackTrace();
/*      */                   }
/*      */                 }
/*      */ 
/*      */               }
/*      */ 
/*  660 */               imageMap.put(name, isStore);
/*      */             }
/*      */           }
/*      */         }
/*      */ 
/*      */       }
/*      */ 
/*  667 */       if (jsonObj.containsKey("style")) {
/*  668 */         JSONArray styleList = (JSONArray)jsonObj.get("style");
/*  669 */         int length = styleList.size();
/*  670 */         if ((styleList != null) && (length > 0)) {
/*  671 */           for (int i = 0; i < length; i++) {
/*  672 */             JSONObject temp = (JSONObject)styleList.get(i);
/*  673 */             if (temp.containsKey("name")) {
/*  674 */               String name = (String)temp.get("name");
/*  675 */               DesignStyle style = convertStyle(temp);
/*  676 */               doc.addStyle(style);
/*  677 */               styleMap.put(name, style);
/*      */             }
/*      */           }
/*      */         }
/*      */       }
/*      */ 
/*  683 */       if (jsonObj.containsKey("name")) {
/*  684 */         String valueString = (String)jsonObj.get("name");
/*  685 */         doc.setName(valueString);
/*      */       }
/*      */ 
/*  688 */       OrientationEnum oeEnum = convertOrientation(jsonObj, "orientation");
/*  689 */       if (oeEnum != null) {
/*  690 */         doc.setOrientation(oeEnum);
/*      */       }
/*      */ 
/*  693 */       if (jsonObj.containsKey("paper")) {
/*  694 */         String valueString = (String)jsonObj.get("paper");
/*  695 */         Paper paper = Paper.findPaper(valueString);
/*  696 */         if (paper != null)
/*  697 */           doc.setPaper(paper);
/*      */         else {
/*  699 */           throw new NullPointerException();
/*      */         }
/*      */ 
/*      */       }
/*      */ 
/*  704 */       if (jsonObj.containsKey("margins")) {
/*  705 */         JSONArray list = (JSONArray)jsonObj.get("margins");
/*  706 */         if (list != null)
/*      */         {
/*      */           Integer topM;
/*      */           Integer rightM;
/*      */           Integer bottomM;
/*  707 */           switch (list.size()) {
/*      */           case 0:
/*  709 */             doc.setMargin(0, 0, 0, 0);
/*  710 */             break;
/*      */           case 1:
/*  712 */             topM = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/*  713 */             doc.setMargin(topM.intValue(), 0, 0, 0);
/*      */           case 2:
/*  715 */             topM = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/*  716 */             rightM = (Integer)list.get(1);
/*  717 */             doc.setMargin(topM.intValue(), rightM.intValue(), 0, 0);
/*  718 */             break;
/*      */           case 3:
/*  720 */             topM = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/*  721 */             rightM = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/*  722 */             bottomM = Integer.valueOf(Integer.parseInt(list.get(2).toString()));
/*  723 */             doc.setMargin(topM.intValue(), rightM.intValue(), bottomM.intValue(), 0);
/*  724 */             break;
/*      */           default:
/*  726 */             topM = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/*  727 */             rightM = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/*  728 */             bottomM = Integer.valueOf(Integer.parseInt(list.get(2).toString()));
/*  729 */             Integer leftM = Integer.valueOf(Integer.parseInt(list.get(3).toString()));
/*  730 */             doc.setMargin(topM.intValue(), rightM.intValue(), bottomM.intValue(), leftM.intValue());
/*      */           }
/*      */         }
/*      */ 
/*      */       }
/*      */ 
/*  736 */       DesignColumnGroup dcg = convertColumnGroup(jsonObj, "columnGroup");
/*  737 */       if (dcg != null) {
/*  738 */         doc.setColumnGroup(dcg);
/*      */       }
/*      */ 
/*  741 */       if (jsonObj.containsKey("background")) {
/*  742 */         JSONObject temp = (JSONObject)jsonObj.get("background");
/*  743 */         DesignBand bgBand = convertBand(temp);
/*  744 */         doc.setBackground(bgBand);
/*      */       }
/*      */ 
/*  747 */       if (jsonObj.containsKey("title")) {
/*  748 */         JSONObject temp = (JSONObject)jsonObj.get("title");
/*  749 */         DesignBand title = convertBand(temp);
/*  750 */         doc.setTitle(title);
/*      */       }
/*  752 */       if (jsonObj.containsKey("pageHeader")) {
/*  753 */         JSONObject temp = (JSONObject)jsonObj.get("pageHeader");
/*  754 */         DesignBand pageHeader = convertBand(temp);
/*  755 */         doc.setPageHeader(pageHeader);
/*      */       }
/*  757 */       if (jsonObj.containsKey("pageFooter")) {
/*  758 */         JSONObject temp = (JSONObject)jsonObj.get("pageFooter");
/*  759 */         DesignBand pageFooter = convertBand(temp);
/*  760 */         doc.setPageFooter(pageFooter);
/*      */       }
/*  762 */       if (jsonObj.containsKey("columnHeader")) {
/*  763 */         JSONObject temp = (JSONObject)jsonObj.get("columnHeader");
/*  764 */         DesignBand columnHeader = convertBand(temp);
/*  765 */         doc.setColumnHeader(columnHeader);
/*      */       }
/*  767 */       if (jsonObj.containsKey("detail")) {
/*  768 */         JSONObject temp = (JSONObject)jsonObj.get("detail");
/*  769 */         DesignBand detail = convertBand(temp);
/*  770 */         doc.setDetail(detail);
/*      */       }
/*  772 */       if (jsonObj.containsKey("columnFooter")) {
/*  773 */         JSONObject temp = (JSONObject)jsonObj.get("columnFooter");
/*  774 */         DesignBand columnFooter = convertBand(temp);
/*  775 */         doc.setColumnFooter(columnFooter);
/*      */       }
/*  777 */       if (jsonObj.containsKey("summary")) {
/*  778 */         JSONObject temp = (JSONObject)jsonObj.get("summary");
/*  779 */         DesignBand summary = convertBand(temp);
/*  780 */         doc.setSummary(summary);
/*      */       }
/*      */     }
/*  783 */     return doc;
/*      */   }
/*      */ 
/*      */   private static DesignStyle convertStyle(JSONObject jsonObj)
/*      */   {
/*  794 */     DesignStyle style = new DesignStyle();
/*  795 */     if (jsonObj.containsKey("name")) {
/*  796 */       String name = (String)jsonObj.get("name");
/*  797 */       style.setName(name);
/*      */     }
/*  799 */     if (jsonObj.containsKey("lineBox")) {
/*  800 */       JSONObject temp = (JSONObject)jsonObj.get("lineBox");
/*  801 */       DesignLineBox lineBox = convertLineBox(temp);
/*  802 */       style.setLineBox(lineBox);
/*      */     }
/*  804 */     if (jsonObj.containsKey("backcolor")) {
/*  805 */       JSONArray list = (JSONArray)jsonObj.get("backcolor");
/*  806 */       Color bgColor = new Color(0, 0, 0);
/*  807 */       if (list != null)
/*      */       {
/*      */         Integer r;
/*      */         Integer g;
/*  808 */         switch (list.size()) {
/*      */         case 0:
/*  810 */           break;
/*      */         case 1:
/*  812 */           r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/*  813 */           bgColor.setRGB(r.intValue(), 0, 0);
/*  814 */           break;
/*      */         case 2:
/*  816 */           r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/*  817 */           g = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/*  818 */           bgColor.setRGB(r.intValue(), g.intValue(), 0);
/*  819 */           break;
/*      */         default:
/*  821 */           Integer b = Integer.valueOf(Integer.parseInt(list.get(2).toString()));
/*  822 */           r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/*  823 */           g = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/*  824 */           bgColor.setRGB(r.intValue(), g.intValue(), b.intValue());
/*      */         }
/*      */       }
/*      */ 
/*  828 */       style.setBackcolor(bgColor);
/*      */     }
/*  830 */     if (jsonObj.containsKey("forcecolor")) {
/*  831 */       JSONArray list = (JSONArray)jsonObj.get("forcecolor");
/*  832 */       Color fgcolor = new Color(0, 0, 0);
/*  833 */       if (list != null)
/*      */       {
/*      */         Integer r;
/*      */         Integer g;
/*  834 */         switch (list.size()) {
/*      */         case 0:
/*  836 */           break;
/*      */         case 1:
/*  838 */           r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/*  839 */           fgcolor.setRGB(r.intValue(), 0, 0);
/*  840 */           break;
/*      */         case 2:
/*  842 */           r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/*  843 */           g = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/*  844 */           fgcolor.setRGB(r.intValue(), g.intValue(), 0);
/*  845 */           break;
/*      */         default:
/*  847 */           Integer b = Integer.valueOf(Integer.parseInt(list.get(2).toString()));
/*  848 */           r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/*  849 */           g = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/*  850 */           fgcolor.setRGB(r.intValue(), g.intValue(), b.intValue());
/*      */         }
/*      */       }
/*      */ 
/*  854 */       style.setForecolor(fgcolor);
/*      */     }
/*  856 */     if (jsonObj.containsKey("horizontalAlign")) {
/*  857 */       String valueString = (String)jsonObj.get("horizontalAlign");
/*      */ 
/*  859 */       HorizontalAlignEnum haEnum = null;
/*  860 */       for (HorizontalAlignEnum ha : HorizontalAlignEnum.values()) {
/*  861 */         if (ha.getName().equals(valueString)) {
/*  862 */           haEnum = ha;
/*  863 */           break;
/*      */         }
/*      */       }
/*  866 */       style.setHorizontalAlign(haEnum);
/*      */     }
/*      */ 
/*  869 */     if (jsonObj.containsKey("verticalAlign"))
/*      */     {
/*  871 */       String valueString = (String)jsonObj.get("verticalAlign");
/*      */ 
/*  873 */       VerticalAlignEnum vaEnum = null;
/*  874 */       for (VerticalAlignEnum va : VerticalAlignEnum.values()) {
/*  875 */         if (va.getName().equals(valueString)) {
/*  876 */           vaEnum = va;
/*  877 */           break;
/*      */         }
/*      */       }
/*  880 */       style.setVerticalAlign(vaEnum);
/*      */     }
/*  882 */     if (jsonObj.containsKey("font")) {
/*  883 */       JSONObject temp = (JSONObject)jsonObj.get("font");
/*  884 */       FontKey fontKey = convertFont(temp);
/*  885 */       if (fontKey != null) {
/*  886 */         style.setFontKey(fontKey);
/*      */       }
/*      */     }
/*      */ 
/*  890 */     if (jsonObj.containsKey("overflow"))
/*      */     {
/*  892 */       String valueString = (String)jsonObj.get("overflow");
/*  893 */       OverflowEnum ofEnum = null;
/*  894 */       for (OverflowEnum of : OverflowEnum.values()) {
/*  895 */         if (of.getName().equals(valueString)) {
/*  896 */           ofEnum = of;
/*  897 */           break;
/*      */         }
/*      */       }
/*      */ 
/*  901 */       style.setOverflow(ofEnum);
/*      */     }
/*  903 */     return style;
/*      */   }
/*      */ 
/*      */   private static DesignLineBox convertLineBox(JSONObject jsonObj)
/*      */   {
/*  914 */     DesignLineBox lineBox = new DesignLineBox();
/*  915 */     if (jsonObj.containsKey("pen")) {
/*  916 */       JSONObject temp = (JSONObject)jsonObj.get("pen");
/*  917 */       LinePen linePen = convertLinePen(temp);
/*  918 */       lineBox.setPen(linePen);
/*      */     }
/*  920 */     if (jsonObj.containsKey("leftPen")) {
/*  921 */       JSONObject temp = (JSONObject)jsonObj.get("leftPen");
/*  922 */       LinePen linePen = convertLinePen(temp);
/*  923 */       lineBox.setLeftPen(linePen);
/*      */     }
/*  925 */     if (jsonObj.containsKey("rightPen")) {
/*  926 */       JSONObject temp = (JSONObject)jsonObj.get("rightPen");
/*  927 */       LinePen linePen = convertLinePen(temp);
/*  928 */       lineBox.setRightPen(linePen);
/*      */     }
/*  930 */     if (jsonObj.containsKey("topPen")) {
/*  931 */       JSONObject temp = (JSONObject)jsonObj.get("topPen");
/*  932 */       LinePen linePen = convertLinePen(temp);
/*  933 */       lineBox.setTopPen(linePen);
/*      */     }
/*  935 */     if (jsonObj.containsKey("bottomPen")) {
/*  936 */       JSONObject temp = (JSONObject)jsonObj.get("bottomPen");
/*  937 */       LinePen linePen = convertLinePen(temp);
/*  938 */       lineBox.setBottomPen(linePen);
/*      */     }
/*  940 */     return lineBox;
/*      */   }
/*      */ 
/*      */   private static LinePen convertLinePen(JSONObject jsonObj)
/*      */   {
/*  945 */     LinePen linePen = new LinePen();
/*  946 */     if (jsonObj.containsKey("color")) {
/*  947 */       JSONArray list = (JSONArray)jsonObj.get("color");
/*  948 */       Color lineColor = new Color(0, 0, 0);
/*  949 */       if (list != null)
/*      */       {
/*      */         Integer r;
/*      */         Integer g;
/*  950 */         switch (list.size()) {
/*      */         case 0:
/*  952 */           break;
/*      */         case 1:
/*  954 */           r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/*  955 */           lineColor.setRGB(r.intValue(), 0, 0);
/*  956 */           break;
/*      */         case 2:
/*  958 */           r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/*  959 */           g = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/*  960 */           lineColor.setRGB(r.intValue(), g.intValue(), 0);
/*  961 */           break;
/*      */         default:
/*  963 */           Integer b = Integer.valueOf(Integer.parseInt(list.get(2).toString()));
/*  964 */           r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/*  965 */           g = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/*  966 */           lineColor.setRGB(r.intValue(), g.intValue(), b.intValue());
/*      */         }
/*      */       }
/*      */ 
/*  970 */       linePen.setLineColor(lineColor);
/*      */     }
/*      */ 
/*  973 */     if (jsonObj.containsKey("lineWidth")) {
/*  974 */       Float tempFloat = Float.valueOf(Float.parseFloat(jsonObj.get("lineWidth") + ""));
/*  975 */       linePen.setLineWidth(tempFloat);
/*      */     }
/*      */ 
/*  978 */     if (jsonObj.containsKey("lineStyle")) {
/*  979 */       String valueString = (String)jsonObj.get("lineStyle");
/*  980 */       LineStyleEnum lsEnum = null;
/*  981 */       for (LineStyleEnum ls : LineStyleEnum.values()) {
/*  982 */         if (ls.getName().equals(valueString)) {
/*  983 */           lsEnum = ls;
/*  984 */           break;
/*      */         }
/*      */       }
/*      */ 
/*  988 */       linePen.setLineStyle(lsEnum);
/*      */     } else {
/*  990 */       linePen.setLineStyle(LineStyleEnum.SOLID);
/*      */     }
/*      */ 
/*  993 */     return linePen;
/*      */   }
/*      */ 
/*      */   private static DesignColumnGroup convertColumnGroup(JSONObject jsonObj, String key)
/*      */   {
/*  998 */     DesignColumnGroup dcg = null;
/*  999 */     JSONArray columns = (JSONArray)jsonObj.get(key);
/*      */ 
/* 1001 */     if ((columns != null) && (columns.size() > 0)) {
/* 1002 */       dcg = new DesignColumnGroup();
/* 1003 */       int length = columns.size();
/* 1004 */       for (int i = 0; i < length; i++) {
/* 1005 */         JSONObject temp = (JSONObject)columns.get(i);
/* 1006 */         DesignColumn dc = new DesignColumn();
/* 1007 */         if ((temp.containsKey("width")) && (temp.get("width") != null)) {
/* 1008 */           dc.setWidth(Integer.parseInt(String.valueOf(temp.get("width"))));
/*      */         }
/* 1010 */         if (temp.containsKey("layout")) {
/* 1011 */           String valueString = (String)temp.get("layout");
/* 1012 */           for (LayoutEnum layout : LayoutEnum.values())
/* 1013 */             if (layout.getName().equals(valueString)) {
/* 1014 */               dc.setLayout(layout);
/* 1015 */               break;
/*      */             }
/*      */         }
/*      */         else {
/* 1019 */           dc.setLayout(LayoutEnum.AUTO);
/*      */         }
/* 1021 */         if (temp.containsKey("alias")) {
/* 1022 */           String valueString = (String)temp.get("alias");
/* 1023 */           dc.setAlias(valueString);
/*      */         }
/* 1025 */         dcg.addColumn(dc);
/*      */       }
/*      */     }
/* 1028 */     return dcg;
/*      */   }
/*      */ 
/*      */   private static LayoutEnum convertLayout(JSONObject jsonObj, String value)
/*      */   {
/* 1040 */     LayoutEnum lEnum = null;
/* 1041 */     String valueString = (String)jsonObj.get(value);
/* 1042 */     for (LayoutEnum layout : LayoutEnum.values()) {
/* 1043 */       if (layout.getName().equals(valueString)) {
/* 1044 */         lEnum = layout;
/* 1045 */         break;
/*      */       }
/*      */     }
/* 1048 */     return lEnum;
/*      */   }
/*      */ 
/*      */   private static LineStyleEnum convertLineStyle(JSONObject jsonObj, String value)
/*      */   {
/* 1053 */     LineStyleEnum lsEnum = null;
/* 1054 */     if (jsonObj.containsKey(value)) {
/* 1055 */       String valueString = (String)jsonObj.get(value);
/* 1056 */       for (LineStyleEnum ls : LineStyleEnum.values()) {
/* 1057 */         if (ls.getName().equals(valueString)) {
/* 1058 */           lsEnum = ls;
/* 1059 */           break;
/*      */         }
/*      */       }
/*      */     }
/* 1063 */     return lsEnum;
/*      */   }
/*      */ 
/*      */   private static DesignBand convertBand(JSONObject jsonObj)
/*      */   {
/* 1074 */     DesignBand band = new DesignBand();
/* 1075 */     if (jsonObj.containsKey("rows")) {
/* 1076 */       JSONArray rows = (JSONArray)jsonObj.get("rows");
/* 1077 */       int length = rows.size();
/* 1078 */       if ((rows != null) && (length > 0)) {
/* 1079 */         for (int i = 0; i < length; i++) {
/* 1080 */           JSONObject temp = (JSONObject)rows.get(i);
/* 1081 */           DesignRow rw = band.addRow();
/* 1082 */           if (temp.containsKey("height")) {
/* 1083 */             Integer h = Integer.valueOf(Integer.parseInt(temp.get("height").toString()));
/* 1084 */             rw.setHeight(h.intValue());
/*      */           }
/*      */ 
/* 1087 */           if (temp.containsKey("detached")) {
/* 1088 */             Boolean d = (Boolean)temp.get("detached");
/* 1089 */             rw.setDetached(d.booleanValue());
/*      */           } else {
/* 1091 */             rw.setDetached(false);
/*      */           }
/*      */ 
/* 1094 */           if (temp.containsKey("layout")) {
/* 1095 */             String valueString = (String)temp.get("layout");
/* 1096 */             LayoutEnum lEnum = convertLayout(temp, valueString);
/* 1097 */             if (lEnum != null)
/* 1098 */               rw.setLayout(lEnum);
/*      */           }
/*      */           else {
/* 1101 */             rw.setLayout(LayoutEnum.FIXED);
/*      */           }
/*      */ 
/* 1104 */           DesignColumnGroup dcg = convertColumnGroup(temp, "columnGroup");
/* 1105 */           if (dcg != null) {
/* 1106 */             rw.setColumnGroup(dcg);
/*      */           }
/*      */ 
/* 1109 */           if (temp.containsKey("cells")) {
/* 1110 */             JSONArray cells = (JSONArray)temp.get("cells");
/* 1111 */             int cLength = cells.size();
/* 1112 */             if ((cells != null) && (cells.size() > 0)) {
/* 1113 */               for (int j = 0; j < cLength; j++) {
/* 1114 */                 JSONObject cTemp = (JSONObject)cells.get(j);
/* 1115 */                 BaseCellElement bce = convertCell(cTemp);
/* 1116 */                 if (bce != null) {
/* 1117 */                   rw.addCell(bce);
/*      */                 }
/*      */               }
/*      */             }
/*      */           }
/*      */         }
/*      */       }
/*      */     }
/*      */ 
/* 1126 */     DesignColumnGroup dcg = convertColumnGroup(jsonObj, "columnGroup");
/* 1127 */     if (dcg != null) {
/* 1128 */       band.setColumnGroup(dcg);
/*      */     }
/* 1130 */     return band;
/*      */   }
/*      */ 
/*      */   private static OrientationEnum convertOrientation(JSONObject jsonObj, String key)
/*      */   {
/* 1142 */     OrientationEnum oeEnum = null;
/* 1143 */     if (jsonObj.containsKey(key)) {
/* 1144 */       String valueString = (String)jsonObj.get(key);
/* 1145 */       for (OrientationEnum o : OrientationEnum.values()) {
/* 1146 */         if (o.getName().equalsIgnoreCase(valueString)) {
/* 1147 */           oeEnum = o;
/* 1148 */           break;
/*      */         }
/*      */       }
/*      */     }
/* 1152 */     return oeEnum;
/*      */   }
/*      */ 
/*      */   private static BaseCellElement convertCell(JSONObject jsonObj)
/*      */   {
/* 1157 */     BaseCellElement be = null;
/*      */ 
/* 1159 */     if (jsonObj.containsKey("amount")) {
/* 1160 */       be = new DesignAmount();
/* 1161 */       String temp = (String)jsonObj.get("amount");
/* 1162 */       BigDecimal tempB = new BigDecimal(temp);
/* 1163 */       ((DesignAmount)be).setAmount(tempB);
/*      */ 
/* 1165 */       if (jsonObj.containsKey("amountDecoration")) {
/* 1166 */         String valueString = (String)jsonObj.get("amountDecoration");
/* 1167 */         AmountDecorationEnum adEnum = convertAmountDecoration(jsonObj, valueString);
/* 1168 */         ((DesignAmount)be).setAmountDecorationEnum(adEnum);
/*      */       }
/*      */       else {
/* 1171 */         ((DesignAmount)be).setAmountDecorationEnum(AmountDecorationEnum.AMOUNT_LINE);
/*      */       }
/*      */ 
/* 1174 */       AmountDecorationEnum tempAd = ((DesignAmount)be).getAmountDecoration();
/* 1175 */       if (((AmountDecorationEnum.CURRNCY_UNIT.equals(tempAd)) || (AmountDecorationEnum.CURRNCY_LINE.equals(tempAd))) && 
/* 1176 */         (jsonObj.containsKey("amountCurrency"))) {
/* 1177 */         String valueString = (String)jsonObj.get("amountCurrency");
/* 1178 */         DesignAmountCurrency amountCurrency = (DesignAmountCurrency)DesignAmountCurrency.CNY;
/* 1179 */         if ((!"HKD".equals(valueString)) || (
/* 1184 */           (!"EUR".equals(valueString)) || (
/* 1189 */           (!"SUR".equals(valueString)) || 
/* 1194 */           ("USD".equals(valueString)))));
/* 1199 */         ((DesignAmount)be).setAmountCurrency(amountCurrency);
/*      */       }
/*      */ 
/* 1203 */       if (jsonObj.containsKey("colspan")) {
/* 1204 */         Integer csp = Integer.valueOf(Integer.parseInt(jsonObj.get("colspan").toString()));
/* 1205 */         be.setColspan(csp.intValue());
/*      */       }
/*      */ 
/* 1208 */       if (jsonObj.containsKey("rowspan")) {
/* 1209 */         Integer rsp = Integer.valueOf(Integer.parseInt(jsonObj.get("rowspan").toString()));
/* 1210 */         be.setRowspan(rsp.intValue());
/*      */       }
/*      */ 
/* 1213 */       if (jsonObj.containsKey("padding")) {
/* 1214 */         JSONArray list = (JSONArray)jsonObj.get("padding");
/* 1215 */         DesignPadding dp = new DesignPadding();
/* 1216 */         if (list != null)
/*      */         {
/*      */           Integer topP;
/*      */           Integer rightP;
/*      */           Integer bottomP;
/* 1217 */           switch (list.size()) {
/*      */           case 0:
/* 1219 */             break;
/*      */           case 1:
/* 1221 */             topP = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1222 */             dp.setTop(topP);
/* 1223 */             break;
/*      */           case 2:
/* 1225 */             topP = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1226 */             rightP = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1227 */             dp.setTop(topP);
/* 1228 */             dp.setRight(rightP);
/* 1229 */             break;
/*      */           case 3:
/* 1231 */             bottomP = Integer.valueOf(Integer.parseInt(list.get(2).toString()));
/* 1232 */             topP = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1233 */             rightP = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1234 */             dp.setTop(topP);
/* 1235 */             dp.setRight(rightP);
/* 1236 */             dp.setBottom(bottomP);
/* 1237 */             break;
/*      */           default:
/* 1239 */             Integer leftP = Integer.valueOf(Integer.parseInt(list.get(3).toString()));
/* 1240 */             bottomP = Integer.valueOf(Integer.parseInt(list.get(2).toString()));
/* 1241 */             topP = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1242 */             rightP = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1243 */             dp.setTop(topP);
/* 1244 */             dp.setRight(rightP);
/* 1245 */             dp.setBottom(bottomP);
/* 1246 */             dp.setLeft(leftP);
/*      */           }
/*      */         }
/*      */ 
/* 1250 */         be.setPadding(dp);
/*      */       }
/*      */ 
/* 1253 */       if (jsonObj.containsKey("backcolor")) {
/* 1254 */         JSONArray list = (JSONArray)jsonObj.get("backcolor");
/* 1255 */         Color bgColor = new Color(0, 0, 0);
/* 1256 */         if (list != null)
/*      */         {
/*      */           Integer r;
/*      */           Integer g;
/* 1257 */           switch (list.size()) {
/*      */           case 0:
/* 1259 */             break;
/*      */           case 1:
/* 1261 */             r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1262 */             bgColor.setRGB(r.intValue(), 0, 0);
/* 1263 */             break;
/*      */           case 2:
/* 1265 */             r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1266 */             g = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1267 */             bgColor.setRGB(r.intValue(), g.intValue(), 0);
/* 1268 */             break;
/*      */           default:
/* 1270 */             Integer b = Integer.valueOf(Integer.parseInt(list.get(2).toString()));
/* 1271 */             r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1272 */             g = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1273 */             bgColor.setRGB(r.intValue(), g.intValue(), b.intValue());
/*      */           }
/*      */         }
/*      */ 
/* 1277 */         be.setBackcolor(bgColor);
/*      */       }
/*      */ 
/* 1280 */       if (jsonObj.containsKey("forcecolor")) {
/* 1281 */         JSONArray list = (JSONArray)jsonObj.get("forcecolor");
/* 1282 */         Color fgColor = new Color(0, 0, 0);
/* 1283 */         if (list != null)
/*      */         {
/*      */           Integer r;
/*      */           Integer g;
/* 1284 */           switch (list.size()) {
/*      */           case 0:
/* 1286 */             break;
/*      */           case 1:
/* 1288 */             r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1289 */             fgColor.setRGB(r.intValue(), 0, 0);
/* 1290 */             break;
/*      */           case 2:
/* 1292 */             r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1293 */             g = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1294 */             fgColor.setRGB(r.intValue(), g.intValue(), 0);
/* 1295 */             break;
/*      */           default:
/* 1297 */             Integer b = Integer.valueOf(Integer.parseInt(list.get(2).toString()));
/* 1298 */             r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1299 */             g = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1300 */             fgColor.setRGB(r.intValue(), g.intValue(), b.intValue());
/*      */           }
/*      */         }
/*      */ 
/* 1304 */         ((DesignAmount)be).setForecolor(fgColor);
/*      */       }
/*      */ 
/* 1307 */       if (jsonObj.containsKey("font")) {
/* 1308 */         JSONObject font = (JSONObject)jsonObj.get("font");
/* 1309 */         FontKey fontKey = convertFont(font);
/* 1310 */         if (fontKey != null) {
/* 1311 */           ((DesignAmount)be).setFontKey(fontKey);
/*      */         }
/*      */ 
/*      */       }
/*      */ 
/* 1316 */       if (jsonObj.containsKey("horizontalAlign")) {
/* 1317 */         String valueString = (String)jsonObj.get("horizontalAlign");
/*      */ 
/* 1319 */         HorizontalAlignEnum haEnum = null;
/* 1320 */         for (HorizontalAlignEnum ha : HorizontalAlignEnum.values()) {
/* 1321 */           if (ha.getName().equals(valueString)) {
/* 1322 */             haEnum = ha;
/* 1323 */             break;
/*      */           }
/*      */         }
/* 1326 */         be.setHorizontalAlign(haEnum);
/*      */       }
/*      */ 
/* 1329 */       if (jsonObj.containsKey("verticalAlign")) {
/* 1330 */         String valueString = (String)jsonObj.get("verticalAlign");
/*      */ 
/* 1332 */         VerticalAlignEnum vaEnum = null;
/* 1333 */         for (VerticalAlignEnum va : VerticalAlignEnum.values()) {
/* 1334 */           if (va.getName().equals(valueString)) {
/* 1335 */             vaEnum = va;
/* 1336 */             break;
/*      */           }
/*      */         }
/* 1339 */         be.setVerticalAlign(vaEnum);
/*      */       }
/*      */ 
/* 1342 */       if (jsonObj.containsKey("expression")) {
/* 1343 */         DesignExpression exp = convertExpression(jsonObj);
/* 1344 */         if (exp != null) {
/* 1345 */           ((DesignText)be).setExpression(exp);
/*      */         }
/*      */       }
/*      */ 
/* 1349 */       if (jsonObj.containsKey("overflow")) {
/* 1350 */         String valueString = (String)jsonObj.get("overflow");
/* 1351 */         OverflowEnum ofeEnum = convertOverflow(jsonObj, valueString);
/* 1352 */         ((DesignText)be).setOverflow(ofeEnum);
/*      */       }
/*      */ 
/* 1355 */       if (jsonObj.containsKey("evaluationTime")) {
/* 1356 */         String valueString = (String)jsonObj.get("evaluationTime");
/* 1357 */         EvaluationTimeEnum etEnum = convertEvaluationTime(jsonObj, valueString);
/* 1358 */         ((DesignText)be).setEvaluationTime(etEnum);
/*      */       }
/*      */ 
/* 1361 */       if (jsonObj.containsKey("printRepeated")) {
/* 1362 */         Boolean prBoolean = (Boolean)jsonObj.get("printRepeated");
/* 1363 */         if (prBoolean != null)
/* 1364 */           be.setPrintRepeated(prBoolean.booleanValue());
/*      */         else {
/* 1366 */           be.setPrintRepeated(false);
/*      */         }
/*      */       }
/*      */ 
/* 1370 */       if (jsonObj.containsKey("stamp")) {
/* 1371 */         JSONObject tempStamp = (JSONObject)jsonObj.get("stamp");
/* 1372 */         StampElement stamp = convertStamp(tempStamp);
/* 1373 */         be.setStampElement(stamp);
/*      */       }
/*      */ 
/* 1376 */       if (jsonObj.containsKey("shapes")) {
/* 1377 */         JSONArray shapes = (JSONArray)jsonObj.get("shapes");
/* 1378 */         if ((shapes != null) && (shapes.size() > 0)) {
/* 1379 */           int length = shapes.size();
/* 1380 */           for (int i = 0; i < length; i++) {
/* 1381 */             JSONObject object = (JSONObject)shapes.get(i);
/* 1382 */             Shape shape = convertShape(object);
/* 1383 */             be.addShape(shape);
/*      */           }
/*      */         }
/*      */       }
/*      */     }
/* 1388 */     else if (jsonObj.containsKey("imageData")) {
/* 1389 */       be = new DesignImage();
/* 1390 */       String imgData = (String)jsonObj.get("imageData");
/*      */ 
/* 1392 */       ImageStore bis = new BytesImageStore();
/* 1393 */       if ((imgData != null) && (imgData.length() > 0)) {
/* 1394 */         ((BytesImageStore)bis).writeBytes(imgData.getBytes());
/* 1395 */         if (jsonObj.containsKey("imageType")) {
/* 1396 */           String valueString = (String)jsonObj.get("imageType");
/* 1397 */           ImageTypeEnum itEnum = convertImageType(jsonObj, valueString);
/* 1398 */           ((BytesImageStore)bis).setImageType(itEnum);
/*      */         }
/*      */       }
/* 1401 */       else if (jsonObj.containsKey("imageStore")) {
/* 1402 */         String temp = (String)jsonObj.get("imageStore");
/* 1403 */         if ((temp != null) && (temp.length() > 0)) {
/* 1404 */           bis = (ImageStore)imageMap.get(temp);
/*      */         }
/*      */ 
/*      */       }
/*      */ 
/* 1409 */       ((DesignImage)be).setImageStore(bis);
/*      */ 
/* 1411 */       if (jsonObj.containsKey("shapes")) {
/* 1412 */         JSONArray shapes = (JSONArray)jsonObj.get("shapes");
/* 1413 */         if ((shapes != null) && (shapes.size() > 0)) {
/* 1414 */           int length = shapes.size();
/* 1415 */           for (int i = 0; i < length; i++) {
/* 1416 */             JSONObject object = (JSONObject)shapes.get(i);
/* 1417 */             Shape shape = convertShape(object);
/* 1418 */             be.addShape(shape);
/*      */           }
/*      */         }
/*      */       }
/* 1422 */       ScaleImageEnum siEnum = ScaleImageEnum.RETAIN;
/* 1423 */       if (jsonObj.containsKey("imageScaleType")) {
/* 1424 */         String value = (String)jsonObj.get("imageScaleType");
/* 1425 */         siEnum = convertScaleImage(jsonObj, value);
/*      */       }
/* 1427 */       ((DesignImage)be).setScaleImage(siEnum);
/*      */ 
/* 1429 */       if (jsonObj.containsKey("colspan")) {
/* 1430 */         Integer csp = Integer.valueOf(Integer.parseInt(jsonObj.get("colspan").toString()));
/* 1431 */         be.setColspan(csp.intValue());
/*      */       }
/*      */ 
/* 1434 */       if (jsonObj.containsKey("rowspan")) {
/* 1435 */         Integer rsp = Integer.valueOf(Integer.parseInt(jsonObj.get("rowspan").toString()));
/* 1436 */         be.setRowspan(rsp.intValue());
/*      */       }
/*      */ 
/* 1439 */       if (jsonObj.containsKey("padding")) {
/* 1440 */         JSONArray list = (JSONArray)jsonObj.get("padding");
/* 1441 */         DesignPadding dp = new DesignPadding();
/* 1442 */         if (list != null)
/*      */         {
/*      */           Integer topP;
/*      */           Integer rightP;
/*      */           Integer bottomP;
/* 1443 */           switch (list.size()) {
/*      */           case 0:
/* 1445 */             break;
/*      */           case 1:
/* 1447 */             topP = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1448 */             dp.setTop(topP);
/* 1449 */             break;
/*      */           case 2:
/* 1451 */             topP = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1452 */             rightP = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1453 */             dp.setTop(topP);
/* 1454 */             dp.setRight(rightP);
/* 1455 */             break;
/*      */           case 3:
/* 1457 */             bottomP = Integer.valueOf(Integer.parseInt(list.get(2).toString()));
/* 1458 */             topP = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1459 */             rightP = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1460 */             dp.setTop(topP);
/* 1461 */             dp.setRight(rightP);
/* 1462 */             dp.setBottom(bottomP);
/* 1463 */             break;
/*      */           default:
/* 1465 */             Integer leftP = Integer.valueOf(Integer.parseInt(list.get(3).toString()));
/* 1466 */             bottomP = Integer.valueOf(Integer.parseInt(list.get(2).toString()));
/* 1467 */             topP = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1468 */             rightP = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1469 */             dp.setTop(topP);
/* 1470 */             dp.setRight(rightP);
/* 1471 */             dp.setBottom(bottomP);
/* 1472 */             dp.setLeft(leftP);
/*      */           }
/*      */         }
/*      */ 
/* 1476 */         be.setPadding(dp);
/*      */       }
/*      */ 
/* 1479 */       if (jsonObj.containsKey("backcolor")) {
/* 1480 */         JSONArray list = (JSONArray)jsonObj.get("backcolor");
/* 1481 */         Color bgColor = new Color(0, 0, 0);
/* 1482 */         if (list != null)
/*      */         {
/*      */           Integer r;
/*      */           Integer g;
/* 1483 */           switch (list.size()) {
/*      */           case 0:
/* 1485 */             break;
/*      */           case 1:
/* 1487 */             r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1488 */             bgColor.setRGB(r.intValue(), 0, 0);
/* 1489 */             break;
/*      */           case 2:
/* 1491 */             r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1492 */             g = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1493 */             bgColor.setRGB(r.intValue(), g.intValue(), 0);
/* 1494 */             break;
/*      */           default:
/* 1496 */             Integer b = Integer.valueOf(Integer.parseInt(list.get(2).toString()));
/* 1497 */             r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1498 */             g = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1499 */             bgColor.setRGB(r.intValue(), g.intValue(), b.intValue());
/*      */           }
/*      */         }
/*      */ 
/* 1503 */         be.setBackcolor(bgColor);
/*      */       }
/*      */ 
/* 1533 */       if (jsonObj.containsKey("horizontalAlign")) {
/* 1534 */         String valueString = (String)jsonObj.get("horizontalAlign");
/*      */ 
/* 1536 */         HorizontalAlignEnum haEnum = null;
/* 1537 */         for (HorizontalAlignEnum ha : HorizontalAlignEnum.values()) {
/* 1538 */           if (ha.getName().equals(valueString)) {
/* 1539 */             haEnum = ha;
/* 1540 */             break;
/*      */           }
/*      */         }
/* 1543 */         be.setHorizontalAlign(haEnum);
/*      */       }
/*      */ 
/* 1546 */       if (jsonObj.containsKey("verticalAlign")) {
/* 1547 */         String valueString = (String)jsonObj.get("verticalAlign");
/*      */ 
/* 1549 */         VerticalAlignEnum vaEnum = null;
/* 1550 */         for (VerticalAlignEnum va : VerticalAlignEnum.values()) {
/* 1551 */           if (va.getName().equals(valueString)) {
/* 1552 */             vaEnum = va;
/* 1553 */             break;
/*      */           }
/*      */         }
/* 1556 */         be.setVerticalAlign(vaEnum);
/*      */       }
/*      */ 
/* 1559 */       if (jsonObj.containsKey("printRepeated")) {
/* 1560 */         Boolean prBoolean = (Boolean)jsonObj.get("printRepeated");
/* 1561 */         if (prBoolean != null)
/* 1562 */           be.setPrintRepeated(prBoolean.booleanValue());
/*      */         else {
/* 1564 */           be.setPrintRepeated(false);
/*      */         }
/*      */       }
/*      */ 
/* 1568 */       if (jsonObj.containsKey("stamp")) {
/* 1569 */         JSONObject temp = (JSONObject)jsonObj.get("stamp");
/* 1570 */         StampElement stamp = convertStamp(temp);
/* 1571 */         be.setStampElement(stamp);
/*      */       }
/*      */     }
/*      */     else {
/* 1575 */       be = new DesignText();
/* 1576 */       String temp = (String)jsonObj.get("text");
/* 1577 */       ((DesignText)be).setText(temp);
/* 1578 */       if (jsonObj.containsKey("style")) {
/* 1579 */         String style = (String)jsonObj.get("style");
/* 1580 */         be.setStyle((DesignStyle)styleMap.get(style));
/*      */       }
/* 1582 */       if (jsonObj.containsKey("font")) {
/* 1583 */         JSONObject font = (JSONObject)jsonObj.get("font");
/* 1584 */         FontKey fontKey = convertFont(font);
/* 1585 */         if (fontKey != null) {
/* 1586 */           ((DesignText)be).setFontKey(fontKey);
/*      */         }
/*      */       }
/*      */ 
/* 1590 */       if (jsonObj.containsKey("expression")) {
/* 1591 */         DesignExpression exp = convertExpression(jsonObj);
/* 1592 */         if (exp != null) {
/* 1593 */           ((DesignText)be).setExpression(exp);
/*      */         }
/*      */       }
/*      */ 
/* 1597 */       if (jsonObj.containsKey("overflow")) {
/* 1598 */         String valueString = (String)jsonObj.get("overflow");
/* 1599 */         OverflowEnum ofeEnum = convertOverflow(jsonObj, valueString);
/* 1600 */         ((DesignText)be).setOverflow(ofeEnum);
/*      */       }
/*      */ 
/* 1603 */       if (jsonObj.containsKey("evaluationTime")) {
/* 1604 */         String valueString = (String)jsonObj.get("evaluationTime");
/* 1605 */         EvaluationTimeEnum etEnum = convertEvaluationTime(jsonObj, valueString);
/* 1606 */         ((DesignText)be).setEvaluationTime(etEnum);
/*      */       }
/*      */ 
/* 1609 */       if (jsonObj.containsKey("colspan")) {
/* 1610 */         Integer csp = Integer.valueOf(Integer.parseInt(jsonObj.get("colspan").toString()));
/* 1611 */         be.setColspan(csp.intValue());
/*      */       }
/*      */ 
/* 1614 */       if (jsonObj.containsKey("rowspan")) {
/* 1615 */         Integer rsp = Integer.valueOf(Integer.parseInt(jsonObj.get("rowspan").toString()));
/* 1616 */         be.setRowspan(rsp.intValue());
/*      */       }
/*      */ 
/* 1619 */       if (jsonObj.containsKey("padding")) {
/* 1620 */         JSONArray list = (JSONArray)jsonObj.get("padding");
/* 1621 */         DesignPadding dp = new DesignPadding();
/* 1622 */         if (list != null)
/*      */         {
/*      */           Integer topP;
/*      */           Integer rightP;
/*      */           Integer bottomP;
/* 1623 */           switch (list.size()) {
/*      */           case 0:
/* 1625 */             break;
/*      */           case 1:
/* 1627 */             topP = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1628 */             dp.setTop(topP);
/* 1629 */             break;
/*      */           case 2:
/* 1631 */             topP = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1632 */             rightP = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1633 */             dp.setTop(topP);
/* 1634 */             dp.setRight(rightP);
/* 1635 */             break;
/*      */           case 3:
/* 1637 */             bottomP = Integer.valueOf(Integer.parseInt(list.get(2).toString()));
/* 1638 */             topP = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1639 */             rightP = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1640 */             dp.setTop(topP);
/* 1641 */             dp.setRight(rightP);
/* 1642 */             dp.setBottom(bottomP);
/* 1643 */             break;
/*      */           default:
/* 1645 */             Integer leftP = Integer.valueOf(Integer.parseInt(list.get(3).toString()));
/* 1646 */             bottomP = Integer.valueOf(Integer.parseInt(list.get(2).toString()));
/* 1647 */             topP = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1648 */             rightP = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1649 */             dp.setTop(topP);
/* 1650 */             dp.setRight(rightP);
/* 1651 */             dp.setBottom(bottomP);
/* 1652 */             dp.setLeft(leftP);
/*      */           }
/*      */         }
/*      */ 
/* 1656 */         be.setPadding(dp);
/*      */       }
/*      */ 
/* 1659 */       if (jsonObj.containsKey("backcolor")) {
/* 1660 */         JSONArray list = (JSONArray)jsonObj.get("backcolor");
/* 1661 */         Color bgColor = new Color(0, 0, 0);
/* 1662 */         if (list != null)
/*      */         {
/*      */           Integer r;
/*      */           Integer g;
/* 1663 */           switch (list.size()) {
/*      */           case 0:
/* 1665 */             break;
/*      */           case 1:
/* 1667 */             r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1668 */             bgColor.setRGB(r.intValue(), 0, 0);
/* 1669 */             break;
/*      */           case 2:
/* 1671 */             r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1672 */             g = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1673 */             bgColor.setRGB(r.intValue(), g.intValue(), 0);
/* 1674 */             break;
/*      */           default:
/* 1676 */             Integer b = Integer.valueOf(Integer.parseInt(list.get(2).toString()));
/* 1677 */             r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1678 */             g = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1679 */             bgColor.setRGB(r.intValue(), g.intValue(), b.intValue());
/*      */           }
/*      */         }
/*      */ 
/* 1683 */         be.setBackcolor(bgColor);
/*      */       }
/*      */ 
/* 1686 */       if (jsonObj.containsKey("forcecolor")) {
/* 1687 */         JSONArray list = (JSONArray)jsonObj.get("forcecolor");
/* 1688 */         Color fgColor = new Color(0, 0, 0);
/* 1689 */         if (list != null)
/*      */         {
/*      */           Integer r;
/*      */           Integer g;
/* 1690 */           switch (list.size()) {
/*      */           case 0:
/* 1692 */             break;
/*      */           case 1:
/* 1694 */             r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1695 */             fgColor.setRGB(r.intValue(), 0, 0);
/* 1696 */             break;
/*      */           case 2:
/* 1698 */             r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1699 */             g = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1700 */             fgColor.setRGB(r.intValue(), g.intValue(), 0);
/* 1701 */             break;
/*      */           default:
/* 1703 */             Integer b = Integer.valueOf(Integer.parseInt(list.get(2).toString()));
/* 1704 */             r = Integer.valueOf(Integer.parseInt(list.get(0).toString()));
/* 1705 */             g = Integer.valueOf(Integer.parseInt(list.get(1).toString()));
/* 1706 */             fgColor.setRGB(r.intValue(), g.intValue(), b.intValue());
/*      */           }
/*      */         }
/*      */ 
/* 1710 */         ((DesignText)be).setForecolor(fgColor);
/*      */       }
/*      */ 
/* 1713 */       if (jsonObj.containsKey("horizontalAlign")) {
/* 1714 */         String valueString = (String)jsonObj.get("horizontalAlign");
/*      */ 
/* 1717 */         HorizontalAlignEnum haEnum = null;
/* 1718 */         for (HorizontalAlignEnum ha : HorizontalAlignEnum.values()) {
/* 1719 */           if (ha.getName().equals(valueString)) {
/* 1720 */             haEnum = ha;
/* 1721 */             break;
/*      */           }
/*      */         }
/* 1724 */         be.setHorizontalAlign(haEnum);
/*      */       }
/*      */ 
/* 1727 */       if (jsonObj.containsKey("verticalAlign")) {
/* 1728 */         String valueString = (String)jsonObj.get("verticalAlign");
/*      */ 
/* 1731 */         VerticalAlignEnum vaEnum = null;
/* 1732 */         for (VerticalAlignEnum va : VerticalAlignEnum.values()) {
/* 1733 */           if (va.getName().equals(valueString)) {
/* 1734 */             vaEnum = va;
/* 1735 */             break;
/*      */           }
/*      */         }
/* 1738 */         be.setVerticalAlign(vaEnum);
/*      */       }
/*      */ 
/* 1741 */       if (jsonObj.containsKey("printRepeated")) {
/* 1742 */         Boolean prBoolean = (Boolean)jsonObj.get("printRepeated");
/* 1743 */         if (prBoolean != null)
/* 1744 */           be.setPrintRepeated(prBoolean.booleanValue());
/*      */         else {
/* 1746 */           be.setPrintRepeated(false);
/*      */         }
/*      */       }
/*      */ 
/* 1750 */       if (jsonObj.containsKey("stamp")) {
/* 1751 */         JSONObject tempStamp = (JSONObject)jsonObj.get("stamp");
/* 1752 */         StampElement stamp = convertStamp(tempStamp);
/* 1753 */         be.setStampElement(stamp);
/*      */       }
/*      */ 
/* 1756 */       if (jsonObj.containsKey("shapes")) {
/* 1757 */         JSONArray shapes = (JSONArray)jsonObj.get("shapes");
/* 1758 */         if ((shapes != null) && (shapes.size() > 0)) {
/* 1759 */           int length = shapes.size();
/* 1760 */           for (int i = 0; i < length; i++) {
/* 1761 */             JSONObject object = (JSONObject)shapes.get(i);
/* 1762 */             Shape shape = convertShape(object);
/* 1763 */             be.addShape(shape);
/*      */           }
/*      */         }
/*      */       }
/*      */     }
/*      */ 
/* 1769 */     return be;
/*      */   }
/*      */ 
/*      */   private static StampElement convertStamp(JSONObject jsonObj)
/*      */   {
/* 1774 */     StampElement se = new DesignImage();
/* 1775 */     if (jsonObj.containsKey("x")) {
/* 1776 */       Integer x = Integer.valueOf(Integer.parseInt(jsonObj.get("x").toString()));
/* 1777 */       ((DesignImage)se).setX(x.intValue());
/*      */     }
/* 1779 */     if (jsonObj.containsKey("y")) {
/* 1780 */       Integer y = Integer.valueOf(Integer.parseInt(jsonObj.get("y").toString()));
/* 1781 */       ((DesignImage)se).setY(y.intValue());
/*      */     }
/*      */ 
/* 1784 */     if (jsonObj.containsKey("flying")) {
/* 1785 */       Boolean fly = (Boolean)jsonObj.get("flying");
/* 1786 */       ((DesignImage)se).setFlying(fly.booleanValue());
/*      */     } else {
/* 1788 */       ((DesignImage)se).setFlying(true);
/*      */     }
/*      */ 
/* 1791 */     if (jsonObj.containsKey("imageData")) {
/* 1792 */       String imgData = (String)jsonObj.get("imageData");
/*      */ 
/* 1794 */       ImageStore bis = new BytesImageStore();
/* 1795 */       if ((imgData != null) && (imgData.length() > 0)) {
/* 1796 */         ((BytesImageStore)bis).writeBytes(imgData.getBytes());
/* 1797 */         if (jsonObj.containsKey("imageType")) {
/* 1798 */           String valueString = (String)jsonObj.get("imageType");
/* 1799 */           ImageTypeEnum itEnum = convertImageType(jsonObj, valueString);
/* 1800 */           ((BytesImageStore)bis).setImageType(itEnum);
/*      */         }
/*      */       }
/* 1803 */       else if (jsonObj.containsKey("imageStore")) {
/* 1804 */         String temp = (String)jsonObj.get("imageStore");
/* 1805 */         if ((temp != null) && (temp.length() > 0)) {
/* 1806 */           bis = (ImageStore)imageMap.get(temp);
/*      */         }
/*      */       }
/*      */ 
/*      */     }
/*      */ 
/* 1812 */     return se;
/*      */   }
/*      */ 
/*      */   private static ImageTypeEnum convertImageType(JSONObject jsonObj, String value)
/*      */   {
/* 1817 */     ImageTypeEnum itEnum = null;
/* 1818 */     if (jsonObj.containsKey(value)) {
/* 1819 */       String valueString = (String)jsonObj.get(value);
/* 1820 */       for (ImageTypeEnum it : ImageTypeEnum.values()) {
/* 1821 */         if (it.getName().equals(valueString)) {
/* 1822 */           itEnum = it;
/* 1823 */           break;
/*      */         }
/*      */       }
/*      */     }
/* 1827 */     return itEnum;
/*      */   }
/*      */ 
/*      */   private static HorizontalAlignEnum convertHorizontalAlign(JSONObject jsonObj, String value)
/*      */   {
/* 1832 */     HorizontalAlignEnum haEnum = null;
/* 1833 */     if (jsonObj.containsKey(value)) {
/* 1834 */       String valueString = (String)jsonObj.get(value);
/* 1835 */       for (HorizontalAlignEnum ha : HorizontalAlignEnum.values()) {
/* 1836 */         if (ha.getName().equals(valueString)) {
/* 1837 */           haEnum = ha;
/* 1838 */           break;
/*      */         }
/*      */       }
/*      */     }
/* 1842 */     return haEnum;
/*      */   }
/*      */ 
/*      */   private static VerticalAlignEnum convertVerticalAlign(JSONObject jsonObj, String value)
/*      */   {
/* 1847 */     VerticalAlignEnum vaEnum = null;
/* 1848 */     if (jsonObj.containsKey(value)) {
/* 1849 */       String valueString = (String)jsonObj.get(value);
/* 1850 */       for (VerticalAlignEnum va : VerticalAlignEnum.values()) {
/* 1851 */         if (va.getName().equals(valueString)) {
/* 1852 */           vaEnum = va;
/* 1853 */           break;
/*      */         }
/*      */       }
/*      */     }
/* 1857 */     return vaEnum;
/*      */   }
/*      */ 
/*      */   private static DesignExpression convertExpression(JSONObject jsonObj)
/*      */   {
/* 1862 */     DesignExpression dex = null;
/* 1863 */     if (jsonObj.containsKey("text")) {
/* 1864 */       String text = (String)jsonObj.get("text");
/* 1865 */       dex = new DesignExpression(text);
/* 1866 */       if (jsonObj.containsKey("pattern")) {
/* 1867 */         String pattern = (String)jsonObj.get("text");
/* 1868 */         dex.setPattern(pattern);
/*      */       }
/* 1870 */       if (jsonObj.containsKey("valueClass")) {
/* 1871 */         String valueClass = (String)jsonObj.get("valueClass");
/* 1872 */         if ((valueClass != null) && (valueClass.length() > 0)) {
/*      */           try
/*      */           {
/* 1875 */             Class cla = Class.forName(valueClass);
/* 1876 */             dex.setValueClass(cla);
/*      */           } catch (ClassNotFoundException e) {
/* 1878 */             e.printStackTrace();
/*      */           }
/*      */         }
/*      */       }
/*      */     }
/* 1883 */     return dex;
/*      */   }
/*      */ 
/*      */   private static OverflowEnum convertOverflow(JSONObject jsonObj, String value)
/*      */   {
/* 1888 */     OverflowEnum ofEnum = null;
/* 1889 */     if (jsonObj.containsKey(value)) {
/* 1890 */       String valueString = (String)jsonObj.get(value);
/* 1891 */       for (OverflowEnum of : OverflowEnum.values()) {
/* 1892 */         if (of.getName().equals(valueString)) {
/* 1893 */           ofEnum = of;
/* 1894 */           break;
/*      */         }
/*      */       }
/*      */     }
/* 1898 */     return ofEnum;
/*      */   }
/*      */ 
/*      */   private static EvaluationTimeEnum convertEvaluationTime(JSONObject jsonObj, String value)
/*      */   {
/* 1903 */     EvaluationTimeEnum etEnum = null;
/* 1904 */     if (jsonObj.containsKey(value)) {
/* 1905 */       String valueString = (String)jsonObj.get(value);
/* 1906 */       for (EvaluationTimeEnum et : EvaluationTimeEnum.values()) {
/* 1907 */         if (et.getName().equals(valueString)) {
/* 1908 */           etEnum = et;
/* 1909 */           break;
/*      */         }
/*      */       }
/*      */     }
/* 1913 */     return etEnum;
/*      */   }
/*      */ 
/*      */   private static FontKey convertFont(JSONObject jsonObj)
/*      */   {
/* 1918 */     FontKey font = new FontKey("宋体", 0, 14);
/* 1919 */     if (jsonObj.containsKey("name")) {
/* 1920 */       String temp = (String)jsonObj.get("name");
/* 1921 */       font.setName(temp);
/*      */     }
/*      */ 
/* 1924 */     if (jsonObj.containsKey("size")) {
/* 1925 */       Integer temp = Integer.valueOf(Integer.parseInt(jsonObj.get("size").toString()));
/* 1926 */       font.setSize(temp.intValue());
/*      */     }
/*      */ 
/* 1929 */     if (jsonObj.containsKey("style")) {
/* 1930 */       String temp = (String)jsonObj.get("style");
/* 1931 */       if ("PLAIN".equals(temp))
/* 1932 */         font.setStyle(0);
/* 1933 */       else if ("BOLD".equals(temp))
/* 1934 */         font.setStyle(1);
/* 1935 */       else if ("ITALIC".equals(temp))
/* 1936 */         font.setStyle(2);
/* 1937 */       else if ("BOLD_ITALIC".equals(temp)) {
/* 1938 */         font.setStyle(3);
/*      */       }
/*      */     }
/* 1941 */     return font;
/*      */   }
/*      */ 
/*      */   private static ScaleImageEnum convertScaleImage(JSONObject jsonObj, String value)
/*      */   {
/* 1946 */     ScaleImageEnum siEnum = null;
/* 1947 */     if (jsonObj.containsKey(value)) {
/* 1948 */       String valueString = (String)jsonObj.get(value);
/* 1949 */       for (ScaleImageEnum si : ScaleImageEnum.values()) {
/* 1950 */         if (si.getName().equals(valueString)) {
/* 1951 */           siEnum = si;
/* 1952 */           break;
/*      */         }
/*      */       }
/*      */     }
/* 1956 */     return siEnum;
/*      */   }
/*      */ 
/*      */   private static AmountDecorationEnum convertAmountDecoration(JSONObject jsonObj, String value)
/*      */   {
/* 1962 */     AmountDecorationEnum adEnum = null;
/* 1963 */     if (jsonObj.containsKey(value)) {
/* 1964 */       String valueString = (String)jsonObj.get(value);
/* 1965 */       for (AmountDecorationEnum ad : AmountDecorationEnum.values()) {
/* 1966 */         if (ad.getName().equals(valueString)) {
/* 1967 */           adEnum = ad;
/* 1968 */           break;
/*      */         }
/*      */       }
/*      */     }
/* 1972 */     return adEnum;
/*      */   }
/*      */ 
/*      */   private static Shape convertShape(JSONObject jsonObj)
/*      */   {
/* 1977 */     Shape shape = null;
/* 1978 */     if (jsonObj.containsKey("type")) {
/* 1979 */       String typeString = (String)jsonObj.get("type");
/* 1980 */       DiagonalLine dline = null;
/*      */       try {
/* 1982 */         Class shpeClass = Class.forName(typeString);
/* 1983 */         Object obj = shpeClass.newInstance();
/* 1984 */         if ("DiagonalLine".equals(typeString)) {
/* 1985 */           dline = (DiagonalLine)obj;
/* 1986 */           if (jsonObj.containsKey("pen")) {
/* 1987 */             JSONObject tempJsonObject = (JSONObject)jsonObj.get("pen");
/* 1988 */             LinePen lPen = convertLinePen(tempJsonObject);
/* 1989 */             dline.setPen(lPen);
/*      */           }
/*      */ 
/* 1992 */           if (jsonObj.containsKey("startPoint"))
/*      */           {
/* 1994 */             String tempString = (String)jsonObj.get("startPoint");
/* 1995 */             if ("T_L".equals(tempString)) {
/* 1996 */               byte sp = 1;
/* 1997 */               dline.setStartPoint(sp);
/* 1998 */             } else if ("T_R".equals(tempString)) {
/* 1999 */               byte sp = 2;
/* 2000 */               dline.setStartPoint(sp);
/* 2001 */             } else if ("B_L".equals(tempString)) {
/* 2002 */               byte sp = 3;
/* 2003 */               dline.setStartPoint(sp);
/*      */             } else {
/* 2005 */               byte sp = 4;
/* 2006 */               dline.setStartPoint(sp);
/*      */             }
/*      */           }
/*      */ 
/* 2010 */           if (jsonObj.containsKey("endPoint")) {
/* 2011 */             String tempString = (String)jsonObj.get("endPoint");
/* 2012 */             if ("T_L".equals(tempString)) {
/* 2013 */               byte sp = 1;
/* 2014 */               dline.setEndPoint(sp);
/* 2015 */             } else if ("T_R".equals(tempString)) {
/* 2016 */               byte sp = 2;
/* 2017 */               dline.setEndPoint(sp);
/* 2018 */             } else if ("B_L".equals(tempString)) {
/* 2019 */               byte sp = 3;
/* 2020 */               dline.setEndPoint(sp);
/*      */             } else {
/* 2022 */               byte sp = 4;
/* 2023 */               dline.setEndPoint(sp);
/*      */             }
/*      */           }
/*      */ 
/* 2027 */           if (jsonObj.containsKey("offsetX"))
/*      */           {
/* 2029 */             Float offsetX = (Float)jsonObj.get("offsetX");
/* 2030 */             dline.setOffsetX(offsetX.floatValue());
/*      */           }
/*      */ 
/* 2033 */           if (jsonObj.containsKey("offsetY")) {
/* 2034 */             Float offsetY = (Float)jsonObj.get("offsetY");
/* 2035 */             dline.setOffsetY(offsetY.floatValue());
/*      */           }
/*      */ 
/* 2038 */           shape = dline;
/*      */         }
/*      */       }
/*      */       catch (Exception e) {
/* 2042 */         e.printStackTrace();
/*      */       }
/*      */     }
/* 2045 */     return shape;
/*      */   }
/*      */ 
/*      */   public static String compile(String pld)
/*      */   {
/* 2056 */     return null;
/*      */   }
/*      */ 
/*      */   static
/*      */   {
/*   63 */     initMap();
/*      */   }
/*      */ }

/* Location:           X:\repository\com\yss\sofa\cml\cml-api\1.1.0\cml-api-1.1.0.jar
 * Qualified Name:     com.yss.sofa.cml.pld.PrintLanguageDefined
 * JD-Core Version:    0.6.0
 */